 package com.sdemo.modules.sys.service.impl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sdemo.modules.sys.mapper.MenuMapper;
import com.sdemo.modules.sys.model.Menu;
import com.sdemo.modules.sys.model.MenuTree;
import com.sdemo.modules.sys.model.TreeMenu;
import com.sdemo.modules.sys.model.User;
import com.sdemo.modules.sys.service.MenuService;

@Service
public class MenuServiceImpl implements MenuService{
	
	@Autowired
	private MenuMapper menuMapper;

	@Override
	public List<Menu> queryMenu() {
		// TODO Auto-generated method stub
		return menuMapper.queryMenu();
	}

	@Override
	public int insertMenu(Menu menu) {
		// TODO Auto-generated method stub
		return menuMapper.insertMenu(menu);
	}

	@Override
	public int deleteMenuByMid(Long mid) {
		// TODO Auto-generated method stub
		return menuMapper.deleteMenuByMid(mid);
	}

	@Override
	public List<TreeMenu> selectMenu(User user) {
		// TODO Auto-generated method stub
		return menuMapper.selectMenu(user);
	}

	@Override
	public List<MenuTree> queryMenuZtree() {
		// TODO Auto-generated method stub
		return menuMapper.queryMenuZtree();
	}

	@Override
	public int updateMenu(Menu menu) {
		// TODO Auto-generated method stub
		return menuMapper.updateMenu(menu);
	}

	@Override
	public List<MenuTree> queryMenuByRoleid(Long roleid) {
		// TODO Auto-generated method stub
		return menuMapper.queryMenuByRoleid(roleid);
	}

	@Override
	public Menu queryMenuByMid(Long mid) {
		// TODO Auto-generated method stub
		return menuMapper.queryMenuByMid(mid);
	}
	
	
	
}
